package ru.fadeev.crammer;

import java.io.File;
import java.io.FileFilter;


/**
 * TextFileFilter represents file filter for .txt files
 * @author Konstantin Fadeyev
 *
 */
public class TextFileFilter implements FileFilter {
	public boolean accept(File file) {
		if (file.isDirectory()) {
			return true;
		}
	
		String extension = Utils.getExtension(file);

		if (extension != null) {
			if (extension.equals("txt")) {
				return true;
			} else {
				return false;
			}
		}
		return false;
    }
}
